package ch05.home;

class Exercise5_08 {
	public static void main(String[] args) {
		int[] answer = { 1, 4, 4, 3, 1, 4, 4, 2, 1, 3, 2 };
		int[] counter = new int[4];

		for (int i = 0; i < answer.length; i++)
			/* <1 */counter[answer[i] - 1]++; /* 1> */

		for (int i = 0; i < counter.length; i++) {
			// <2
			System.out.print(i+1+": "+counter[i]);
			for (int j = 0; j < counter[i]; j++) 
				System.out.print("*"); 
			// 2>

			System.out.println();
		}
	}
}
/*
1: 3***
2: 2**
3: 2**
4: 4****
*/